latexwikiaorg-20200214-history
List of LaTeX environments
A LaTeX environment is one of the following: __TOC__ Float environments Text inside a float environment is "floated" according to its placement, an optional parameter. The standard and classes use the default placement tbp. The float environments are and . Figure environment \begin{figure}placement % body of the figure \caption{figure title} \end{figure} Placement is one of the following :h (Here) - at the position in the text where the table environment appears. :t (Top) - at the top of a text page. :b (Bottom) - at the bottom of a text page. :p (Page) of floats - on a separate float page, which is a page containing no text, only floats. Table environment The table environment has the same characteristics as the figure environment. List environments The list environments are , , , and the generic , which is seldom used in text, but often in macros. Within a list environment commands are used to identify the items in the list. description environment The description environment produces a labeled list. \begin{description} \item label First item \item label Second item :... \end{description} enumerate environment The enumerate environment produces a numbered list. At least one item is needed. Enumerate lists can be nested inside other enumerate lists, up to four levels deep. \begin{enumerate} \item First item \item Second item :... \end{enumerate} itemize environment The itemize environment creates an unnumbered, or "bulleted" list. \begin{itemize} \item First item \item Second item :... \end{itemize} list environment \begin{list}{label}{fmt-params} \item First item \item Second item :... \end{list} ;label :specifies how items should be labeled. This argument is a piece of text that is inserted in a box to form the label. This argument can and usually does contain other LaTeX commands. ;fmt-params :contains commands to change the spacing parameters for the list. An empty argument will select all default spacing which should suffice for most cases. :The format parameters are: (See external reference for a diagram of these) ::\itemsep ::\labelsep ::\labelwidth ::\leftmargin ::\listparindent ::\parsep ::\parskip ::\partopsep ::\rightmargin ::\topsep Math environments The math environments are , , , , , and math environment The math environment is used within paragraph mode to place mathematical symbols inline with the paragraph's text. The following are all equivalent: :\( … \) :$ … $ :\begin{math}…\end{math} In a wiki, the ... tags create a math environment. displaymath environment The following are equivalent: :\[ … \] :$$ … $$ :\begin{displaymath}…\end{displaymath} Note: The AMS Short Math Guide recommends against using $$ ... $$ to enter displaymath mode, because it is not documented in the TeX manual, and because it interferes with the proper operation of the fleqn option. split environment The environment is used to write multiple lines that are aligned using the ampersand (&) character. b+c-d\\ & \quad +e-f\\ & g+h\\ \end{split}|\begin{split} a& b+c-d\\ & \quad +e-f\\ & g+h\\ \end{split}|aligning a series of equations}} array environment The array environment is used to make a table of information, with column alignment (left, center, or right) and optional vertical lines separating the columns. \begin{array}{col1col2…coln} item11 & item12 … & item1n\\ item21 & item22 … & item2n\\ :... itemn1 & itemn2 … & itemnn\\ \end{array} Each of col1, col2, etc. is a single letter, :c - for centred :l - for flush left :r - for flush right :The column format letters can be interspersed with vertical bars ( ), which result in rendering vertical bars as needed in the formatted matrix. If a horizontal line is needed in the matrix, \ can be used. Within the matrix itself, columns are separated by an &, and each row ends with a double backslash, \\. eqnarray environment \begin{eqnarray} math formula 1 math formula 2 :... \end{eqnarray} The eqnarray environment is An equation number is placed on every line unless that line has a \ command. The command \ is used for splitting long formulas across lines. It typesets its argument in display style flush left in a box of zero width. equation environment The environment centers the equation, and places an equation number in the right margin. \begin{equation} ... math formula \end{equation} An asterisk is used for unnumbered equations: \begin{equation*} ... math formula \end{equation*} An equation can be given a label using the \ command, which can later be referenced using the \ command. \begin{equation}\label{xyz} ... math formula \end{equation} :Later, the equation can be referenced, as an example, by ... using equation \eqref{xyz}, one can derive the following... :\eqref{xyz} generates a parenthesized equation number; it is equivalent to (\ {xyz}). The preamble command, \ {equation}{section} can be used to number equations with the two-level name m.n (section number.equation number). The environment affixes letters a, b, c... to the end of the equation number within the environment. \begin{equation}\label{first} x=y+z \end{equation} some intervening text \begin{subequations}\label{grp} \begin{align} a&=b+c\label{second}\\ d&=e+f+g\label{third}\\ h&=i+j\label{fourth} \end{align} \end{subequations} :numbers equation x=y+z as, for example, 2.9, then the group a=b+c, d=e+f+g, and h=i+j will be numbered, respectively, 2.10a, 2.10b, and 2.10c. The "parent" equation number, 2.10, is assigned to the label "grp". The environment lets you split equations over multiple lines, aligning the beginning of the equation with the left margin, and the end of it with the right margin. Equations are numbered. \begin{multline} a+b+c+d+e+f\\ +i+j+k+l+m+n \end{multline} The environment gathers and centers equations; each equation is numbered; not available in wiki. \begin{gather} a_1=b_1+c_1\\ a_2=b_2+c_2-d_2+e_2 \end{gather} The environment lets you use the ampersand (&) to align multiple equations; each equation is numbered; not available in wiki. \begin{align} a_{11}& =b_{11}& a_{12}& =b_{12}\\ a_{21}& =b_{21}& a_{22}& =b_{22}+c_{22} \end{align} The environment lets you use the ampersand (&) to align multiple equations. The leftmost and rightmost columns are aligned with the margins. \begin{flalign*} a_{11}& =b_{11}& a_{12}& =b_{12}\\ a_{21}& =b_{21}& a_{22}& =b_{22}+c_{22} \end{flalign*} theorem environment The environment produces "Therem x" in bold face, followed by your theorem text. \begin{theorem} ... theorem text \end{theorem} Matrix environments The matrix environments are , , , , , , and . Each provides a table for expressions, aligned in rows and columns. The main difference between the various types of matrix is the kind of delimeters that surround them. Each row of a matrix ends with two backslashes (\\). Each column ends with an ampersand (&). Cases environment The environment is used to left-brace a group of equations or a piecewise-defined function, for example, \begin{cases} n/2 &\ {if } n \ 0 \\ (3n +1)/2 & \mbox{if } n \equiv 1. \end{cases} \ {2} |f(n) \begin{cases} n/2 &\mbox{if } n \equiv 0 \\ (3n +1)/2 & \mbox{if } n \equiv 1. \end{cases} \pmod{2} |function defined piecewise}} align and alignat environments The environment can be used to align equations. The environment can be used to align equations, and explicitly specify the number of "equation" columns. An equation column has two parts, separated by the equals-sign. Essentially, this is an array with alternating right-aligned and left-aligned columns. The required parameter of alignat is the maximum number of ampersands in a row plus 1, and then divided by 2. One use of alignat is to explicitly specify the amount of horizontal space between columns by including the required spacing in the first row. For some reason, in the wikia wiki, the "align" and "alignat" environments cause errors. Paragraph environments The paragraph environments are , , , , , , , and . Within a paragraph environment, each line must be terminated with a double backslash, \\. Related commands are , , , , , , and center environment The center environment allows you to create a paragraph consisting of lines that are centered within the left and right margins on the current page. flushleft environment The flushleft environment allows you to create a paragraph consisting of lines that are flushed left, to the left-hand margin. flushright environment The flushright environment allows you to create a paragraph consisting of lines that are flushed right, to the right-hand margin. minipage environment The minipage environment is similar to the \ command. It is not advisable to nest minipage environments, because it messes up footnote positioning. \begin{minipage}position{width} ... text \end{minipage} quotation environment The margins of the quotation environment are indented on the left and the right. The text is justified at both margins and there is paragraph indentation. quote environment The margins of the quotation environment are indented on the left and the right. The text is justified at both margins without paragraph indentation verbatim environment Uses typewriter (\ ) style, similar to the \ command. verse environment The verse environment is designed for poetry. The margins are indented on the left and the right. End each lines with \\, and use a blank line to separate the stanzas. Picture environment \begin{picture}(width,height)(x offset,y offset) :... picture commands \end{picture} ;picture commands are :\ :\ :\ :\ :\ :\ :\ :\ :\ :\ :\ :\ Table environments tabbing environment In the environment, * Tab stops are set with \=. * \> advances to the next tab stop. * \+ ends a line, and begins the next line one tab stop to the right. * \- ends a line, and begins the next line one tab stop to the left. \begin{tabbing} function \= fact(n : integer) : integer; :\> begin \= \+ ::\> if \= n $>$ 1 then \+ :::fact := n * fact(n-1) \- ::else \+ :::fact := 1; \-\- :end; \end{tabbing} Related commands are :\= :\> :\ :\ :\ :\ :\ :\ :\ :\ :\ :\ :\ :\ tabular environment The environment uses ampersands (&) to separate columns. \begin{tabular}pos{cols} column 1 entry & column 2 entry … & column n entry :... \end{tabular} :::or \begin{tabular*}{width}pos{cols} column 1 entry & column 2 entry … & column n entry :... \end{tabular*} Other environments Thebibliography environment The environment is used to print a bibliography. Related commands are , , \begin{thebibliography}{widest-label} \bibitemlabel{cite_key} :... \end{thebibliography} Titlepage environment The environment is used to print a title page. It has no printed page number or page heading. The following page is numbered page 1. A related commands is . \begin{titlepage} :... title page text \end{titlepage} External references * [http://latex.computersci.org/Reference/ListEnvironments diagram showing how format parameters are used in list environments] * Wikipedia:Help:Displaying a formula * Category:Language reference